// (c) Copyright 2013 Mike Riedel.
// This source is subject to the Microsoft Public License (Ms-PL).
// All other rights reserved.

using System;
using System.Diagnostics;

namespace FreshMeat.ErrorHandlingBlock
{
   /// <summary>
   /// A plan that does not do any retries.
   /// </summary>
   [DebuggerNonUserCode]
   public class NoRetryPlan : IRetryPlan
   {
      /// <summary>
      /// Determine whether to retry based on the number of attempts.
      /// </summary>
      /// <param name="attempts">The number of attempts so far, including the initial attempt.</param>
      /// <returns>True to retry, false to fail.</returns>
      public bool ShouldRetry(int attempts)
      {
         return false;
      }

      /// <summary>
      /// Gets the time until the next attempt should be made.
      /// </summary>
      /// <param name="attempts">The number of attempts so far, including the initial attempt.</param>
      /// <returns>Time until the next attempt should be made.</returns>
      public TimeSpan GetTimeUntilNextAttempt(int attempts)
      {
         return TimeSpan.MaxValue;
      }
   }
}